package com.panshi.modules.domain;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * <p>
 * 
 * </p>
 *
 * @author 857
 * @since 2020-07-29
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value="SysMenu对象", description="")
public class SysMenu implements Serializable {

    private static final long serialVersionUID = 1L;

        @ApiModelProperty(value = "系统功能表ID")
        @TableId(value = "id", type = IdType.AUTO)
        private Integer id;

        @ApiModelProperty(value = "功能表名称")
        private String menuname;

        @ApiModelProperty(value = "类型:10-目录,20-菜单,30-按钮")
        private Integer type;

        @ApiModelProperty(value = "url地址")
        private String url;

        @ApiModelProperty(value = "父ID")
        private Integer pid;

        @ApiModelProperty(value = "具体操作权限,crud")
        private String permission;


        @TableField(exist = false) //表示是自定义属性
        private List<SysMenu> children;

        @ApiModelProperty(value = "图标")
        private String icon;

        @ApiModelProperty(value = "排序")
        private Integer orderNumber;

        @ApiModelProperty(value = "创建时间")
        @TableField(fill = FieldFill.INSERT)
        @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
        private Date createTime;

        @ApiModelProperty(value = "修改时间")
        @TableField(fill = FieldFill.INSERT_UPDATE)
        @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
        private Date updateTime;

        @ApiModelProperty(value = "状态:1-启用,0-禁用")
        private Integer status;
}
